
#include	"SysConfig.h"
#include	"Define.h"
#include	"Port.h"

#pragma SECTION program UserBoot_Sector

void BOOT_Delay(unsigned char Delay)
{
	unsigned long i;
	
	for(i = 0;i < Delay; ++i)
	{
		M_NOP;
	}
}

void BOOT_memset(unsigned char *ucBuf, unsigned char ucData, unsigned short ucCnt)
{
	unsigned short i;

	for(i = 0; i < ucCnt; ++i)
	{
		*(ucBuf + i) = ucData;
	}
}

void BOOT_memcpy(unsigned char *ucBuf, unsigned char *ucData, unsigned short ucCnt)
{
	unsigned short i;

	for(i = 0; i < ucCnt; ++i)
	{
		*(ucBuf + i) = *(ucData + i);
	}
}
void BOOT_Main_memcpy(unsigned short *ucBuf, unsigned short far *ucData, unsigned short ucCnt)
{
	unsigned short i;

	for(i = 0; i < ucCnt; ++i)
	{
		*(ucBuf + i) = *(ucData + i);
	}
}

void BOOT_Timer1msec(unsigned short Times)
{
	unsigned short i;
	unsigned char TimerUnderFlow;

	Times = Times / 5;
	for(i = 0; i < Times; ++i)
	{
		ir_ta0ic = 0;
		ta0s = 1;	// Timer A0 count start flag
		while(1)
		{
			if  (ir_ta0ic == 1)
			{
				break;
			}
		}
	}
}

